let { merge } = require('webpack-merge')
let common = require('./webpack.common')
const CopyPlugin = require("copy-webpack-plugin");
let path = require('path')
module.exports = merge(common, {
  mode: "production",
  devtool: 'source-map', // 生产环境可能会用
  plugins: [
    new CopyPlugin({
      patterns: [
        {
          from: path.resolve(__dirname, '../public'),
          to: path.resolve(__dirname, '../app'),
          filter(path) {
            return !(/\.html$/.test(path))
          }
        }
      ]
    })
  ]
})